mll_dat <- data.frame(tag = c("dual language programming", "translanguaging", "heritage language courses", "dual language programming", "translanguaging", "heritage language courses"),
percentage = c(.12, .08, .07, .15, .11, .09),
mll_focus = c("No", "No", "No", "Yes", "Yes", "Yes"))
mll_viz <- mll_dat %>%
ggplot(aes(tag, percentage, fill = mll_focus)) +
geom_bar(position = position_dodge2(reverse = TRUE), stat = "identity") +
bar_y_scale_percent +
theme(panel.grid.major.x = element_blank()) +
scale_fill_manual(values = transcend_cols,
labels=c('All Canopy schools', 'Focus on Multilingual Students')) +
labs(title = "Rate of selection for language-related practices",
x = "",
y = "Percentage of Canopy schools",
fill = "School type") +
scale_x_tag() +
theme(legend.position = c(.75,.85))ggsave_transcend(mll_viz, "mll_figure1", dir = here("final_products/essay-charts/mll_figures"), fig_width = 12, fig_height = 8)## Warning in labels(...): Missing tag label
## Warning in labels(...): Missing tag label
We should look at modeling results to draw any strong conclusions, but I’ve created a barplot below displaying the biggest tagging differences between the two groups for the core tags selected.
I defined “inclusive” as those schools that indicated they were either designing for the needs of marginalized student groups or have all courses designed for inclusion.
Analyst note I do not trust the plot below - simple difference in tagging is good to see, however, the number of schools that fell into the “inclusive” bucket (N = 217) was far bigger than those that were not (N = 34). Might be good to think more about how to account for such a difference in sample. modified 6.25.23
inclusive_diff <-
full %>%
select(school_id, inc = practices_all_courses_designed_for_inclusion, marg = practices_design_marginalized, starts_with("core")) %>%
mutate(inclusive = case_when(
(inc == 1 | marg == 1) ~ "inclusive",
(inc == 0 & marg == 0) ~ "not"
)) %>%
select(!c(inc, marg)) %>%
rename_all(funs(sub("core", "practices", .))) %>%
select(!c(practices_all_courses_designed_for_inclusion, practices_design_marginalized)) %>%
pivot_longer(cols = starts_with("practices"),
names_to = "tag",
values_to = "n") %>%
select(!school_id) %>%
mutate(rate = rep(1, nrow(.))) %>%
group_by(inclusive, tag) %>%
summarize(n = sum(n),
rate = sum(rate),
pct = n/rate) %>%
ungroup() %>%
pivot_wider(names_from = inclusive,
values_from = c(n, rate, pct)) %>%
mutate(diff = abs(round(100*(pct_inclusive - pct_not), 2))) %>%
pivot_longer(cols = !c(tag, diff),
names_to = c("col", "inclusive"),
names_sep = "_",
values_to = "value") %>%
pivot_wider(names_from = col,
values_from = value) %>%
arrange(desc(diff)) %>%
slice(1:20) %>%
ggplot(., aes(reorder(tag, -diff), pct, fill = inclusive)) +
geom_bar(position = "dodge", stat = "identity") +
bar_y_scale_percent +
theme(panel.grid.major.y = element_blank()) +
scale_fill_manual(values = c(transcend_cols[1], transcend_cols[3])) +
scale_x_discrete(labels = label_tags(wrap = 25)) +
coord_flip() +
labs(title = "Largest differences in core practices between<br>schools that are <span style = 'color: #1A4C81;'>designing for inclusion</span> and <span style = 'color: #EF464B;'>not</span>",
x = "",
y = "") +
theme(plot.title = element_markdown()) +
theme(legend.position = "none")## Warning: `funs()` was deprecated in dplyr 0.8.0.
## ℹ Please use a list of either functions or lambdas:
##
## # Simple named list: list(mean = mean, median = median)
##
## # Auto named with `tibble::lst()`: tibble::lst(mean, median)
##
## # Using lambdas list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## `summarise()` has grouped output by 'inclusive'. You can override using the
## `.groups` argument.
inclusive_diffggsave("finding-20.png", plot = inclusive_diff, path = here("final_products", "draft-findings"),
width = 12, height = 8, units = "in")inclusive_dumbell2 <- inclusive_dumb_dat %>%
mutate(order = case_when(
tag == "practices_mtss_academics" ~ 1,
tag == "practices_udl" ~ 2,
tag == "practices_mentoring" ~ 3,
tag == "practices_competency_framework" ~ 4,
tag == "practices_community_partnerships" ~ 5,
tag == "practices_co_leaders" ~ 6,
tag == "practices_grading_mastery" ~ 7,
tag == "practices_assessments_agency" ~ 8,
tag == "practices_teachers_leaders" ~ 9,
tag == "practices_design_thinking" ~ 10
)) %>%
ggplot(., aes(x=pct, y=fct_reorder(tag, -order))) +
geom_line(linetype= "dotted",
color = "black") +
geom_point(aes(x=pct,
y = fct_reorder(tag, -order),
color = inclusive),
size=3,
show.legend = FALSE) +
geom_text(aes(x=pct,
y=tag,
label = scales::label_percent(accuracy = 1)(pct)),
nudge_x = .03,
size = 4,
family = "sans",
color = transcend_grays[1]) +
bar_x_scale_percent +
# scale_x_continuous(limits = c(0, 1), labels = scales::percent) +
scale_color_manual(name ="",
values = c(transcend_cols[1],transcend_cols[3]),
breaks = c("inclusive","not"),
labels=c("Designing for Inclusion","Not Designing for Inclusion")) +
labs(title = "Largest differences in selected practices between schools that<br>are <span style = 'color: #1A4C81;'>focused on inclusion </span> and <span style = 'color: #EF464B;'>schools that are not </span>",
subtitle = stringr::str_wrap("Schools designing for inclusion (N = 39) were those that selected 'design to meet the needs of students who have been marginalized' or 'all courses designed for inclusion' as one of the top five core practices that are central to their approach. The remainder (N = 212) did not select either of those practices as a core practice.", width = 95),
x = "",
y = "") +
theme(plot.title = element_markdown(),
panel.grid.major = element_blank(),
legend.position = c(.75,.25)) +
scale_y_discrete(labels = label_tags(wrap = 25)) +
geom_hline(yintercept = 7.5, linetype = 5, color = "gray40") +
geom_text(x = .99, y = 7.9, color = "#1A4C81", label = "Schools designing for inclusion \nmore frequently selected these", hjust = "right") +
geom_text(x = .99, y = 1.1, color = "#EF464B", label = "Schools that did not select designing \nfor inclusion more frequently selected these", hjust = "right")
inclusive_dumbell2ggsave_transcend(inclusive_dumbell2, "cover_figure8", dir = here("final_products/essay-charts/cover_figures"), fig_width = 12, fig_height = 8)inclusive_dumb_dat = inclusive_dumb_dat |>
mutate(
real_diff = pct[inclusive == "inclusive"] - pct[inclusive == "not"],
sign = factor(sign(real_diff)),
is_min = pct == min(pct),
.by = tag
) |>
mutate(
slope_label = ifelse(
inclusive == "not",
percent_format(accuracy = 1)(pct),
paste(percent_format(accuracy = 1)(pct), label_tags()(tag))
),
sign_label = ifelse(
sign == "1",
"More common when\nfocused on inclusion",
"Less common when\nfocused on inclusion") %>%
factor() %>% fct_rev()
)
inclusive_dumb_mids = inclusive_dumb_dat |>
summarize(
mid = mean(pct),
diff = first(diff/100),
.by = c(tag, sign, sign_label)
)
inclusive_dumbell3 = ggplot(
data = inclusive_dumb_dat %>%
mutate(tag = fct_reorder(tag, real_diff)),
aes(x = pct, y = tag)) +
geom_line(
linetype = "dotted",
color = "black"
) +
geom_point(
aes(color = inclusive),
size = 3,
show.legend = FALSE
) +
geom_text(
aes(label = scales::label_percent(accuracy = 1)(pct)),
nudge_x = ifelse(inclusive_dumb_dat$is_min, -.03, .03),
size = 4,
family = "sans",
hjust = 0.5,
color = transcend_grays[1]
) +
geom_text(data = inclusive_dumb_mids, aes(
x = mid, y = tag,
label = paste("Δ =", label_percent(accuracy = 1)(diff))
),
nudge_y = 0.2,
hjust = 0.5
) +
bar_x_scale_percent +
scale_color_manual(name ="",
values = c(transcend_cols[1],transcend_cols[3]),
breaks = c("inclusive","not"),
labels=c("Designing for Inclusion","Not Designing for Inclusion")) +
labs(title = "Largest differences in selected practices between schools that<br>are <span style = 'color: #1A4C81;'>focused on inclusion </span> and <span style = 'color: #EF464B;'>schools that are not </span>",
subtitle = stringr::str_wrap("Schools designing for inclusion (N = 39) were those that selected 'design to meet the needs of students who have been marginalized' or 'all courses designed for inclusion' as one of the top five core practices that are central to their approach. The remainder (N = 212) did not select either of those practices as a core practice.", width = 95),
x = "",
y = "") +
scale_y_discrete(labels = label_tags(wrap = 25)) +
facet_grid(rows = vars(sign_label), scales = "free_y", space = "free_y") +
theme(
plot.title = element_markdown(),
panel.grid.major = element_blank(),
panel.spacing = unit(0, "lines"),
strip.text = element_text(size = rel(0.8), hjust = 0.5),
axis.line = element_blank()
)
inclusive_dumbell3ggsave_transcend(
inclusive_dumbell3, "cover_figure8_dumbbell_v3",
dir = here("final_products/essay-charts/cover_figures"),
fig_width = 12, fig_height = 8, write_data = FALSE
)
# slope chart
library(ggrepel)
incl_slopegraph = ggplot(inclusive_dumb_dat,
aes(x = inclusive, y = pct, color = sign, group = tag)) +
geom_point(size = 2) +
geom_line() +
geom_text_repel(
aes(label = slope_label),
nudge_x = ifelse(inclusive_dumb_dat$inclusive == "not", -.08, .1),
#direction = "y",
min.segment.length = 10
) +
labs(
x = "", y = "Schools selecting each practice (%)",
title = "Practices with the biggest difference in selection\nbetween schools focused vs not focused on inclusion",
subtitle = stringr::str_wrap("Schools designing for inclusion (N = 39) were those that selected 'design to meet the needs of students who have been marginalized' or 'all courses designed for inclusion' as one of the top five core practices that are central to their approach. The remainder (N = 212) did not select either of those practices as a core practice.", width = 85)
) +
scale_color_discrete(guide = "none") +
scale_y_continuous(guide = "none") +
scale_x_discrete(
limits = c("not", "inclusive"),
labels = c("Schools\nnot focused\non inclusion", "Schools\nfocused\non inclusion"),
expand = expansion(mult = 0, add = c(0.2, 1.8))
) +
theme(
panel.grid.major = element_blank(),
panel.border = element_blank(),
axis.line.x = element_blank()
#axis.text = element_text(size = rel(0.8)),
#axis.title = element_text(size = rel(0.8))
)
incl_slopegraphggsave_transcend(
incl_slopegraph, "cover_figure8_slopegraph",
dir = here("final_products/essay-charts/cover_figures"),
fig_width = 8.1, fig_height = 9
)